<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>margin-conflict</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }

        div{
            width: 200px;
            height: 200px;
        }
        .one{
            background-color: orange;
            margin-bottom: 20px;
        }
        .two{
            background-color: green;
            margin-top: 30px;
        }
        .father{
            background-color: orange;
            margin-top: 10px;
        }        
        .son{
            width: 100px;
            height: 100px;
            background-color: green;
            margin-top: 20px;
        }

    </style>
</head>
<body>
    <!-- 兄弟标签上下外边距会塌陷 -->
    <div class="one"></div>
    <div class="two"></div>
    <!-- 父子标签上外边距会塌陷 -->
    <div class="father">
        <div class="son">

        </div>
    </div>

</body>
</html>